using System;
using System.ComponentModel.Composition.Hosting;
using System.Reflection;
using MefContrib.Models.Provider.Definitions.Configurable;
using NUnit.Framework;

namespace MefContrib.Models.Provider.Tests.Definitions
{
    [TestFixture]
    public class ConfigurableDefinitionProviderTests : DefinitionProviderTests
    {
        private readonly CompositionContainer _container;

        public ConfigurableDefinitionProviderTests()
        {
            var provider = new ConfigurableDefinitionProvider("mef.configuration");
            var catalog = new DefinitionProviderPartCatalog<ConfigurableDefinitionProvider>(provider);
            var assemblyCatalog = new AssemblyCatalog(Assembly.GetExecutingAssembly());
            var aggregateCatalog = new AggregateCatalog(catalog, assemblyCatalog);
            
            _container = new CompositionContainer(aggregateCatalog);
        }

        protected override CompositionContainer Container
        {
            get { return _container; }
        }
    }
}